﻿@model NRemedy.WS_Incident
@{
    ViewBag.Title = "事件详情";
    RemedyMVC.Controllers.IncidentController c = ViewContext.Controller as RemedyMVC.Controllers.IncidentController;
    ControlDisplayStatus p1S = c.p1.Compute(Model);
    ControlDisplayStatus p2S = c.p2.Compute(Model);
    ControlDisplayStatus p3S = c.p3.Compute(Model);
    ControlDisplayStatus p4S = c.p4.Compute(Model);
    ControlDisplayStatus p5S = c.p5.Compute(Model);
    ControlDisplayStatus p6S = c.p6.Compute(Model);
    ControlDisplayStatus p7S = c.p7.Compute(Model);


    InputDisplayStatus status1S = c.status1.Compute(Model);
    InputDisplayStatus status2S = c.status2.Compute(Model);
    //InputDisplayStatus status3S = c.status3.Compute(Model);
    //InputDisplayStatus status4S = c.status4.Compute(Model);

    int stageNumber = 0;
    if (Model.IncidentStatus == "已记录" || Model.IncidentStatus == "已重开")
    {
        stageNumber = 0;
    }
    else if (Model.IncidentStatus == "已分派")
    {
        stageNumber = 1;
    }
    else if (Model.IncidentStatus == "处理中" || Model.IncidentStatus == "暂停中")
    {
        stageNumber = 2;
    }
    else if (Model.IncidentStatus == "已解决")
    {
        stageNumber = 3;
    }
    else if (Model.IncidentStatus == "已关闭")
    {
        stageNumber = 4;
    }
    //工作单
    NRemedyGrid<NRemedy.WS_Task> grid_WorkOrder = new NRemedyGrid<NRemedy.WS_Task>(
        new { style = "width:750px;height:380px", id = "table_workorder", title = "事件工作单" },
        new { pagination = true, fitColumns = true, singleSelect = true, toolbar = "#tb2" },
        //new { onBeforeLoad = "workorder_BeforeLoad" }
        null
        )
        .Column(m => m.RequestID, "ID", null, new { hidden = true })
        .Column(m => m.Sequence, "工序", null, new { sortable = true, width = 90 })
        .Column(m => m.AssigneeGroup, "负责团队", null, new { width = 90 })
        .Column(m => m.Assignee, "处理人员", null, new { width = 90 })
        .Column(m => m.Priority, "优先级", null, new { width = 90 })
        .Column(m => m.tms_status, "状态", null, new { width = 90 })
        .Column(m => m.TaskName, "主题", null, new { width = 90 })
        .Column(m => m.CreatedDateTime, "创建时间", null, new { width = 90 })
        .Qulification("EXTERNAL($1003$)");

    RouteValueDictionary detail = new RouteValueDictionary();
    detail.Add(NRemedyUIExtension.FormModelKey, "Detail");
    detail.Add("id", Model.IncidentNumber);

    //日志
    NRemedyGrid<NRemedy.WS_Incident_Journal> incident_journal = new NRemedyGrid<NRemedy.WS_Incident_Journal>(
        new { style = "width:750px;height:380px", id = "table_worklog", title = "事件工作日志" },
        new { fitColumns = true, singleSelect = true, pagination = true, toolbar = "#tb" },
        //new { onBeforeLoad = "worklog_BeforeLoad"} 
        null
        ).
        Column(p => p.RequestID, "ID", null, new { hidden = true, width = 50 }).
        Column(p => p.Category, "类型", null, new { width = 50 }).
        Column(p => p.CreateBy, "创建人", null, new { width = 50 }).
        Column(p => p.CreateTime, "创建时间", null, new { width = 150 }).
        Column(p => p.Subject, "主题", null, new { width = 100 }).
        Qulification("EXTERNAL($1002$)");


    //审计日志
    NRemedyGrid<NRemedy.WS_Incident_Audit> incident_audit = new NRemedyGrid<NRemedy.WS_Incident_Audit>(
        new { style = "width:750px;height:380px", id = "table_audit", title = "事件审计日志" },
        new { fitColumns = true, singleSelect = true, pagination = true, loader = "auto_err_Loader" },
        new { onBeforeLoad="audit_query" }
        ).
        Column(p => p.OriginalRequestID, "PID", null, new { hidden = true, styler = "audit_style" }).
        Column(p => p.Category, "事件大类", null, new { width = 100, styler = "audit_style" }).
        Column(p => p.SubCategory, "事件小类", null, new { width = 100, styler = "audit_style" }).
        Column(p => p.OwnerTeam, "负责团队", null, new { width = 100, styler = "audit_style" }).
        Column(p => p.Owner, "负责人", null, new { width = 80, styler = "audit_style" }).
        Column(p => p.Subject, "主题", null, new { width = 150, styler = "audit_style" }).
        Column(p => p.LastModBy, "最后修改人", null, new { width = 80, styler = "audit_style" }).
        Column(p => p.LastModDateTime, "最后修改时间", null, new { width = 130, styler = "audit_style" });
        
}
<script type="text/javascript">
    function edit(obj) {

        //修改日志
        if (obj.id == "btn_Detail") {
            var selectedRow = $('#table_worklog').datagrid('getSelected');
            if (selectedRow == null) {
                $.messager.alert("操作提示", "请先选择要修改的工作日志！");
                return false;
            }
            var id = selectedRow.f1;
            //window.open('@Url.Action("JournalDetail", "Journal", null)' + '?RequestID=' + id + '&Operate=Edit');
            window.open('@Url.Action("Form", "Journal", new { formmodel = "Detail", type = "incidentjournal", id = "" })' + '/' + id);
        }
        //修改工作单
        if (obj.id == "btn_Detail2") {
            var selectedRow = $('#table_workorder').datagrid('getSelected');
            if (selectedRow == null) {
                $.messager.alert("操作提示", "请先选择要修改的工作单！");
                return false;
            }
            var id = selectedRow.f1;
            //window.open('@Url.Action("TaskDetails", "Task", null)' + '?RequestID=' + id);
            window.open('@Url.Action("Form", "Task", new { formmodel = "Detail" })' + '/' + id);
        }
    }
    function add(obj) {
        //新增日志
        if (obj.id == "btn_Create") {

            window.open('@Url.Action("Form", "Journal", new { formmodel = "Create", type = "incidentjournal", id = Model.IncidentNumber })');
            //window.open('@Url.Action("JournalDetail", "Journal", null)' + '?RequestID=' + '@Model.IncidentNumber' + '&Operate=Add');
        }
        //新增工作单
        if (obj.id == "btn_Create2") {
            //window.open('@Url.Action("TaskDetails", "Task", null)' + '?ParentOBJID=' + '@Model.IncidentNumber' + '');
            window.open('@Url.Action("Form", "Task", new { formmodel = "Create" })' + '/' + '@Model.IncidentNumber');
        }

    }
    $(function () {
        //为date类添加一个format方法
        //yyyy 年
        //MM 月
        //dd 日
        //hh 小时
        //mm 分
        //ss 秒
        //qq 季度
        //S  毫秒
        Date.prototype.formatDate = function (format) //author: meizz
        {
            var o = {
                "M+": this.getMonth() + 1, //month
                "d+": this.getDate(),    //day
                "h+": this.getHours(),   //hour
                "m+": this.getMinutes(), //minute
                "s+": this.getSeconds(), //second
                "q+": Math.floor((this.getMonth() + 3) / 3),  //quarter
                "S": this.getMilliseconds() //millisecond
            }
            if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
            (this.getFullYear() + "").substr(4 - RegExp.$1.length));
            for (var k in o) if (new RegExp("(" + k + ")").test(format))
                format = format.replace(RegExp.$1,
              RegExp.$1.length == 1 ? o[k] :
                ("00" + o[k]).substr(("" + o[k]).length));
            return format;
        }


        //注册事件数据表的一些事件
        $('#table_worklog').datagrid({

            //双击行事件
            onDblClickRow: function (rowIndex, rowData) {

                window.open('@Url.Action("Form", "Journal", new { formmodel = "Detail", type = "incidentjournal", id = "" })' + '/' + rowData.f1);
                //window.open('@Url.Action("JournalDetail", "Journal", null)' + '?RequestID=' + rowData.f1 + '&Operate=Edit');
            }
        });
        $('#table_workorder').datagrid({

            //双击行事件
            onDblClickRow: function (rowIndex, rowData) {
                //window.open('@Url.Action("TaskDetails", "Task", null)' + '?RequestID=' + rowData.f1);
                window.open('@Url.Action("Form", "Task", new { formmodel = "Detail" })' + '/' + rowData.f1);
            }
        });

        $('#536870938').datetimebox({
            showSeconds: true,
            formatter: function (date) {
                return date.formatDate("yyyy/MM/dd hh:mm:ss");
            }
        });

        $('#stage@(stageNumber)').bind('click', function (e) {
            e.preventDefault();
            $('#mm').menu('show', {
                left: e.pageX,
                top: e.pageY
            });
        });
    });

    function SelectCallBack(ta, record) {
        //选择事件小类后，通过查询将最长解决时间赋值
        $.get("/Incident/GetDuration", { Category: $("input[type='hidden'][name='Category']").val(), SubCategory: record.v })
                  .done(function (data) {
                      $("input[name='EstimatedEffortMinute']").val(data);
                  })
    }

    function audit_style(value, row, index) {
        if (index > 0) {
            //check browser capability
            if (value != $('#table_audit').datagrid('getData').rows[index - 1][this.field])
                return 'background-color:#ffee00;color:red;';
        }
    }

    function audit_query(ta, param) {
        param.qu = "'450'=\"" + $('#@(NeedKeyAttribute.ARRequestID)').val() + "\""
    }

    $(document).ready(function () {

        $("#Name").autocomplete({
            source: "/Incident/GetNameListByName/" + $("#Name").val(), // 自动填充的备选数据，注1  
            position: { my: "left top", at: "left bottom" }, // 下拉列表相对于文本框的位置，注2  
            minLength: 1, // 自动填充被激活前需要输入的最小字符数，默认为1  
            delay: 300, // 停止输入到自动填充被激活的延迟时间，默认为300  
            autoFocus: false, // 是否自动聚焦于下拉列表第一项，默认为false  
            appendTo: "body", // 自动填充的下拉列表放到哪个元素内部，注3  
            disabled: false, // 是否禁用自动填充，默认为false  
            create: function (event, ui) { }, // 自动填充被创建时被触发  
            search: function (event, ui) { }, // 在达到最小输入字符数并且延迟时间结束之后，自动填充数据请求开始之前被触发  
            open: function (event, ui) { }, // 下拉列表打开时被触发  
            focus: function (event, ui) { }, // 下拉列表项被聚焦时触发，ui.item对应被聚焦的列表项  
            select: function (event, ui) { }, // 下拉列表项被选择时触发，ui.item对应被选择的列表项  
            close: function (event, ui) { }, // 下拉列表隐藏时被触发  
            change: function (event, ui) {
                $.get("/Incident/GetPeopleInfoByName", { Name: $("#Name").val() })
            .done(function (data) {
                $("#Phone").val(data.Phone);
                $("#Email").val(data.Email);
                $("#BranchOffice").val(data.BranchOffice);
                $("#Location").val(data.Location);
                $("#Department").val(data.Department);
                $("#Seat").val(data.Seat);
            })
            } // 文本域的值发生改变时被触发，ui.item对应新的被选择的列表项  
        });
    })


</script>
<style type="text/css">
    div.stage
    {
        margin-left: 2px;
        padding-left: 5px;
        height: 45px;
        line-height: 45px;
        width: 145px;
        float: left;
        font-weight: bold;
        color: #fff;
    }
</style>
<div class="easyui-layout" id="wrap" style="height: 700px;">
    @using (Html.BeginForm())
    {
        <input id="@NeedKeyAttribute.ARRequestID" value="@Model.RequestID" style="display:none"/>
        <div data-options="region:'west'" id="body_left" style="width: 250px; border-right-style: none;">
            <div title="事件" class="easyui-panel" border="false" style="height: 359px;">
                <table class="left-input-layout">
                    <tr>
                        <td class="label">
                            ID
                        </td>
                        <td>
                            @Model.IncidentNumber
                        </td>
                    </tr>
                    <tr>
                        <td class="label">
                            状态
                        </td>
                        <td>
                            @Html.MenuFor(m => m.IncidentStatus, new RemedyMVC.Menu.Menu_Incident_Status(), null, new { disabled = true }, false)
                        </td>
                    </tr>
                </table>
            </div>
            <div title="快速操作" class="easyui-panel" border="false" style="height: 300px;">
            </div>
        </div>  
        <div data-options="region:'center',iconCls:'icon-ok'" id="body_center">
            <div class="easyui-layout" data-options="fit:true">
                <div id="control-bar" data-options="region:'north',border:false" style="height: 55px;
                    overflow: hidden;">
                    <div style="margin: 5px 100px 5px 271px;">
                        <div id="stage0" class="stage" style="background-color:@(stageNumber == 0 ? "#8BBA30;cursor:pointer" : "#04ACAD")">
                            标识和记录</div>
                        <div id="stage1" class="stage" style="background-color:@(stageNumber == 1 ? "#8BBA30;cursor:pointer" : "#04ACAD")">
                            调查与诊断</div>
                        <div id="stage2" class="stage" style="background-color:@(stageNumber == 2 ? "#8BBA30;cursor:pointer" : "#04ACAD")">
                            解决和恢复</div>
                        <div id="stage3" class="stage" style="background-color:@(stageNumber == 3 ? "#8BBA30;cursor:pointer" : "#04ACAD")">
                            已解决</div>
                        <div id="stage4" class="stage" style="background-color:@(stageNumber == 4 ? "#8BBA30;cursor:pointer" : "#04ACAD")">
                            已关闭</div>
                        <div style="clear: both;">
                        </div>
                    </div>
                    <div id="mm" class="easyui-menu" minwidth="50">
                        @if (p1S == ControlDisplayStatus.Normal || p1S == ControlDisplayStatus.Normal)
                        {
                            <!--已记录状态可以点击分派和已解决按钮-->
                            <div>
                                <a id="btn_submit" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.Assigned" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">分派</a>
                            </div>
                            <div>
                                <a id="btn_resolved" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.Resolve" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">解决</a>
                            </div>
                        }
                        @if (p2S == ControlDisplayStatus.Normal)
                        {
                            <!--已分派状态可以点击接受和重分派按钮-->
                            <div>
                                <a id="btn_assign" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.Accepted" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">接受</a>
                            </div>
                            <div>
                                <a id="btn_assign2" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.ReAssigned" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">重分派</a>
                            </div>                            
                        }
                        @if (p3S == ControlDisplayStatus.Normal)
                        {
                            <!--处理中状态可以点击解决按钮-->
                            <div>
                                <a id="Resolve" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.Resolve" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">解决</a>
                            </div>
                            
                            
                        }
                        @if (p7S == ControlDisplayStatus.Normal)
                        {
                            <!--处理中状态可以点击暂停-->
                            <div>
                                <a id="Pending" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.Pending" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">暂停</a>
                            </div> 
                            
                        }
                        @if (p4S == ControlDisplayStatus.Normal)
                        {
                            <!--暂停中,只能点击取消暂停按钮-->
                            <div>
                                <a id="Pending2" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.CancelPending" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">取消暂停</a></div>
                        }
                        @if (p5S == ControlDisplayStatus.Normal)
                        {
                            <!--已解决状态可以点击关闭和重开按钮-->
                            <div>
                                <a id="Closed" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.Closed" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">关闭</a></div>
                            <div>
                                <a id="Reopened" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.Reopened" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">重开</a></div>
                            <div style="display: none;">
                                <a id="MailTo" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.MailTo" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">邮件回访</a></div>                   
                        }
                        @if (p6S == ControlDisplayStatus.Normal)
                        {
                            <!--已重开可以点击分派按钮-->
                            <div>
                                <a id="Assigned" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.Assigned" href="#" 
                    class="easyui-linkbutton commit-change-mod" 
                    action="@Url.Action("Form", detail)" 
                    data-options="plain:true">分派</a></div>
                        }
                    </div>
                </div>
                <div data-options="region:'west',border:true,split:false" style="width: 275px; height: 300px;
                    border-bottom-style: none; border-left-style: none;">
                    <table class="left-input-layout" style="border: 1px solid #003366; margin-top: 5px;">
                        <tr>
                            <td>
                                <label style="font-weight: bolder;">
                                    客户信息</label>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    姓名:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.InputFor(m => m.FullName, null)
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.InputFor(m => m.FullName, new { disabled = true })

                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    电话/分机:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.InputFor(m => m.Phone, null)
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.InputFor(m => m.Phone, new { disabled = true })

                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    电邮:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.InputFor(m => m.Email, null)
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.InputFor(m => m.Email, new { disabled = true })

                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    分公司:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.InputFor(m => m.BranchOffice, null)
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.InputFor(m => m.BranchOffice, new { disabled = true })

                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    地点:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.InputFor(m => m.Location, null)
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.InputFor(m => m.Location, new { disabled = true })

                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    部门:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.InputFor(m => m.Department, null)
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.InputFor(m => m.Department, new { disabled = true })

                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    座位:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.InputFor(m => m.Seat, null)
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.InputFor(m => m.Seat, new { disabled = true })

                                }
                            </td>
                        </tr>
                    </table>
                    <table class="left-input-layout" style="border: 1px solid #003366; width: 247px;">
                        <tr>
                            <td>
                                <label>
                                    事件来源:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                   
                                    @Html.MenuFor(m => m.Source, new RemedyMVC.Menu.Menu_Incident_Source())
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    
                                    @Html.MenuFor(m => m.Source, new RemedyMVC.Menu.Menu_Incident_Source(), null, new { disabled = true })
                                }
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 60px;">
                                <label>
                                    事件类型:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    
                                    @Html.MenuFor(m => m.TypeOfIncident, new RemedyMVC.Menu.Menu_Incident_Type())
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.MenuFor(m => m.TypeOfIncident, new RemedyMVC.Menu.Menu_Incident_Type(), null, new { disabled = true })
                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    事件大类:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.MenuFor(m => m.Category, new RemedyMVC.Menu.Menu_Incident_Category())
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.MenuFor(m => m.Category, new RemedyMVC.Menu.Menu_Incident_Category(), null, new { disabled = true })
                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    事件小类:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.MenuFor(m => m.SubCategory, new RemedyMVC.Menu.Menu_Incident_SubCategory(), null, null)
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.MenuFor(m => m.SubCategory, new RemedyMVC.Menu.Menu_Incident_SubCategory(), null, new { disabled = true })
                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    症状类别:</label>
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.MenuFor(m => m.SymptomType, new RemedyMVC.Menu.Menu_Incident_SymptomType())
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.MenuFor(m => m.SymptomType, new RemedyMVC.Menu.Menu_Incident_SymptomType(), null, new { disabled = true })
                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                影响度：
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.MenuFor(m => m.Impact, new RemedyMVC.Menu.Menu_Incident_Impact())
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    
                                    @Html.MenuFor(m => m.Impact, new RemedyMVC.Menu.Menu_Incident_Impact(), null, new { disabled = true })
                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                紧迫度：
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.MenuFor(m => m.Urgency, new RemedyMVC.Menu.Menu_Incident_Urgency())
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.MenuFor(m => m.Urgency, new RemedyMVC.Menu.Menu_Incident_Urgency(), null, new { disabled = true })
                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                优先级：
                            </td>
                            <td>
                                @if (status1S == InputDisplayStatus.Normal)
                                {
                                    @Html.MenuFor(m => m.Priority, new RemedyMVC.Menu.Menu_Incident_Priority())
                                }
                                else if (status1S == InputDisplayStatus.Disabled)
                                {
                                    @Html.MenuFor(m => m.Priority, new RemedyMVC.Menu.Menu_Incident_Priority(), null, new { disabled = true })
                                }
                            </td>
                        </tr>
                    </table>
                    <table class="left-input-layout">
                        <tr>
                            <td>
                                @if (Model.IncidentStatus == "已关闭" || Model.IncidentStatus == "暂停中")
                                {
                                    <a class="easyui-linkbutton" data-options="iconCls:'icon-save',disabled:true">保存</a>
                                }
                                else
                                {
                                    <a id="btn_save" name="@RemedyMVC.Controllers.IncidentController.Incident_Action.Logged" 
                                href="#" class="easyui-linkbutton commit-change-mod" 
                                action="@Url.Action("Form", detail)"  
                                data-options="iconCls:'icon-save'">保存</a>
                                }
                            </td>
                        </tr>
                    </table>
                </div>
                <div data-options="region:'center',border:false">
                    <div class="easyui-tabs" style="height: 600px" border="false">
                        <div title="事件详情" style="padding: 10px">
                            <table class="left-input-layout">
                                <tr>
                                    <td class="top-label">
                                        主题
                                    </td>
                                    <td>
                                        @if (status1S == InputDisplayStatus.Normal)
                                        {
                                            @Html.TextAreaFor(m => m.Subject, new { style = "width: 300px" }, false)
                                        }
                                        else
                                        {
                                            @Html.TextAreaFor(m => m.Subject, new { style = "width: 300px", disabled = "disabled" }, false)
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        症状
                                    </td>
                                    <td>
                                        @if (status1S == InputDisplayStatus.Normal)
                                        {
                                            @Html.TextAreaFor(m => m.Symptom, new { style = "width: 300px" }, false)
                                        }
                                        else
                                        {
                                            @Html.TextAreaFor(m => m.Symptom, new { style = "width: 300px", disabled = "disabled" }, false)
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        负责团队
                                    </td>
                                    <td>
                                        @if (status1S == InputDisplayStatus.Normal)
                                        {
                                            @Html.MenuFor(m => m.OwnerTeam, new RemedyMVC.Menu.Menu_Incident_OwnerTeam())
                                        }
                                        else
                                        {
                                            @Html.MenuFor(m => m.OwnerTeam, new RemedyMVC.Menu.Menu_Incident_OwnerTeam(), null, new { disabled = true })
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        处理人员
                                    </td>
                                    <td>
                                        @if (status2S == InputDisplayStatus.Normal)
                                        {
                                            @Html.MenuFor(m => m.Owner, new RemedyMVC.Menu.Menu_Incident_Owner())
                                        }
                                        else
                                        {
                                            @Html.MenuFor(m => m.Owner, new RemedyMVC.Menu.Menu_Incident_Owner(), null, new { disabled = true })
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        最晚解决期限
                                    </td>
                                    <td>
                                        @if (status1S == InputDisplayStatus.Normal)
                                        {
                                            @Html.InputFor(m => m.TargetResolutionTime, new { style = "width: 300px" }, false)
                                        }
                                        else
                                        {
                                            @Html.InputFor(m => m.TargetResolutionTime, new { style = "width: 300px", disabled = true }, false)
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        最长解决时长
                                    </td>
                                    <td>
                                        @if (status1S == InputDisplayStatus.Normal)
                                        {
                                            @Html.InputFor(m => m.EstimatedEffortMinute, new { style = "width: 300px" })
                                        }
                                        else
                                        {
                                            @Html.InputFor(m => m.EstimatedEffortMinute, new { style = "width: 300px", disabled = true })
                                        }
                                    </td>
                                </tr>
                                @*<tr>
                                    <td class="top-label">
                                        CI项计数
                                    </td>
                                    <td>
                                        @if (status1S == InputDisplayStatus.Normal)
                                        {
                                            @Html.InputFor(m => m.CICount, new { style = "width: 300px" }, false)
                                        }
                                        else
                                        {
                                            @Html.InputFor(m => m.CICount, new { style = "width: 300px", disabled = "disabled" }, false)
                                        }
                                    </td>
                                </tr>
                                *@
                            </table>
                        </div>
                        <div title="解决方案" style="overflow: auto; padding: 20px;">
                            <table class="left-input-layout">
                                <tr>
                                    <td class="top-label">
                                        解决方案大类
                                    </td>
                                    <td>
                                        @if (status2S == InputDisplayStatus.Normal)
                                        {
                                            @Html.MenuFor(m => m.ActualCategory, new RemedyMVC.Menu.Menu_Incident_ResolutionCategory())
                                        }
                                        else
                                        {
                                            @Html.MenuFor(m => m.ActualCategory, new RemedyMVC.Menu.Menu_Incident_ResolutionCategory(), null, new { disabled = true })
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        解决方案小类
                                    </td>
                                    <td>
                                        @if (status2S == InputDisplayStatus.Normal)
                                        {
                                            @Html.MenuFor(m => m.ActualSubCategory, new RemedyMVC.Menu.Menu_Incident_ResolutionSubCategory())
                                        }
                                        else
                                        {
                                            @Html.MenuFor(m => m.ActualSubCategory, new RemedyMVC.Menu.Menu_Incident_ResolutionSubCategory(), null, new { disabled = true })
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        发生原因
                                    </td>
                                    <td>
                                        @if (status2S == InputDisplayStatus.Normal)
                                        {
                                            
                                            @Html.MenuFor(m => m.CauseCode, new RemedyMVC.Menu.Menu_Incident_ResolutionCauseCode())
                                            
                                        }
                                        else
                                        {
                                            @Html.MenuFor(m => m.CauseCode, new RemedyMVC.Menu.Menu_Incident_ResolutionCauseCode(), null, new { disabled = true })
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        解决途径
                                    </td>
                                    <td>
                                        @if (status2S == InputDisplayStatus.Normal)
                                        {
                                            
                                            @Html.MenuFor(m => m.WayOfResolution, new RemedyMVC.Menu.Menu_Incident_WayOfResolution())
                                            
                                        }
                                        else
                                        {
                                            @Html.MenuFor(m => m.WayOfResolution, new RemedyMVC.Menu.Menu_Incident_WayOfResolution(), null, new { disabled = true })
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        解决代码
                                    </td>
                                    <td>
                                        @if (status2S == InputDisplayStatus.Normal)
                                        {
                                            
                                            @Html.MenuFor(m => m.ResolveCode, new RemedyMVC.Menu.Menu_Incident_ResolveCode())
                                            @Html.InputFor(m => m.IsWorkAround, new { type = "checkbox" })
                                            <label>
                                                权益措施</label>
                                        }
                                        else
                                        {
                                            @Html.MenuFor(m => m.ResolveCode, new RemedyMVC.Menu.Menu_Incident_ResolveCode(), null, new { disabled = true })
                                            @Html.InputFor(m => m.IsWorkAround, new { type = "checkbox", disabled = true })
                                            <label>
                                                权益措施</label>
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        解决方案
                                    </td>
                                    <td>
                                        @if (status2S == InputDisplayStatus.Normal)
                                        {
                                            
                                            @Html.TextAreaFor(m => m.Resolution, new { style = "width: 230px;height:100px" }, false)
                                            
                                        }
                                        else
                                        {
                                            @Html.TextAreaFor(m => m.Resolution, new { style = "width: 230px;height:100px", disabled = true }, false)
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        变更编码
                                    </td>
                                    <td>
                                        @if (status2S == InputDisplayStatus.Normal)
                                        {
                                            
                                            @Html.InputFor(m => m.AppChangeNumber, null)
                                            
                                        }
                                        else
                                        {
                                            @Html.InputFor(m => m.AppChangeNumber, new { disabled = true })
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        操作类型
                                    </td>
                                    <td>
                                        @if (status2S == InputDisplayStatus.Normal)
                                        {
                                            
                                            @Html.MenuFor(m => m.AppTypeOfOperation, new RemedyMVC.Menu.Menu_Incident_AppTypeOfOperation())
                                            
                                        }
                                        else
                                        {
                                            @Html.MenuFor(m => m.AppTypeOfOperation, new RemedyMVC.Menu.Menu_Incident_AppTypeOfOperation(), null, new { disabled = true })
                                        }
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        产生原因
                                    </td>
                                    <td>
                                        @if (status2S == InputDisplayStatus.Normal)
                                        {
                                            
                                            @Html.MenuFor(m => m.AppTypeOfChange, new RemedyMVC.Menu.Menu_Incident_AppTypeOfChange())
                                            
                                        }
                                        else
                                        {
                                            @Html.MenuFor(m => m.AppTypeOfChange, new RemedyMVC.Menu.Menu_Incident_AppTypeOfChange(), null, new { disabled = true })
                                        }
                                    </td>
                                </tr>
                            </table>
                        </div>
                        @* <div title="解决过程" style="padding: 20px;">
                            <table class="left-input-layout">
                                <tr>
                                    <td class="top-label">
                                        解决方案大类
                                    </td>
                                    <td>
                                    
                                    </td>
                                </tr>
                                <tr>
                                    <td class="top-label">
                                        解决方案小类
                                    </td>
                                    <td>
                                       
                                    </td>
                                </tr>
                            </table>
                        </div>*@
                        <div title="工作单" style="padding: 20px;">
                            @if (status2S == InputDisplayStatus.Normal)
                            {
                                @grid_WorkOrder.GetHtml()
                                <div id="tb2" style="height: auto">
                                    <a id="btn_Create2" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'"
                                        onclick="javascript:add(this)">创建</a> <a id="btn_Detail2" class="easyui-linkbutton"
                                            data-options="plain:true,iconCls:'icon-remove'" onclick="javascript:edit(this)">
                                            查看</a>
                                </div>
                                
                            }
                            else
                            {
                                <div>
                                    <h2>
                                        你此时无法查看或修改工作单</h2>
                                </div>
                            }
                            <input type="text" id="1003" value="@(string.Format("('536870914' = \"{0}\")", Model.IncidentNumber))" style="display: none;" />
                        </div>
                        <div title="日志" style="padding: 20px;">
                            @if (status2S == InputDisplayStatus.Normal)
                            {
                                @incident_journal.GetHtml()
                                <div id="tb" style="height: auto">
                                    <a id="btn_Create" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'"
                                        onclick="javascript:add(this)">创建</a> <a id="btn_Detail" class="easyui-linkbutton"
                                            data-options="plain:true,iconCls:'icon-remove'" onclick="javascript:edit(this)">
                                            查看</a>
                                </div>
                            }
                            else
                            {
                                <div>
                                    <h2>
                                        你此时无法查看或修改工作日志</h2>
                                </div>
                            }
                            <input type="text" id="1002" value="@(string.Format("('536870934' = \"{0}\")", Model.IncidentNumber))" style="display: none;" />
                        </div>
                        <div title="附件" style="padding: 20px; display: none;">
                            tab3
                        </div>
                        <div title="相关请求" style="padding: 20px; display: none;">
                            tab3
                        </div>
                        <div title="相关配置" style="padding: 20px; display: none;">
                            tab3
                        </div>
                        <div title="审计日志" style="padding: 20px">
                            @incident_audit.GetHtml()
                        </div>
                        @*<div title="操作单" style="padding: 20px; display: none;">
                            tab3
                        </div>*@
                        <div title="日期/人员信息" style="padding: 10px">
                            <table class="left-input-layout">
                                <tr>
                                    <td class="label">
                                        事件创建人
                                    </td>
                                    <td>
                                        @Html.InputFor(m => m.CreatedBy, new { disabled = true }, false)
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label">
                                        事件创建时间
                                    </td>
                                    <td>
                                        @Html.InputFor(m => m.CreatedDateTime, new { disabled = true }, false)
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label">
                                        事件修改人
                                    </td>
                                    <td>
                                        @Html.InputFor(m => m.LastModBy, new { disabled = true }, false)
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label">
                                        事件更改时间
                                    </td>
                                    <td>
                                        @Html.InputFor(m => m.LastModDateTime, new { disabled = true }, false)
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label">
                                        事件解决人
                                    </td>
                                    <td>
                                        @Html.InputFor(m => m.ResolvedBy, new { disabled = true }, false)
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label">
                                        事件解决时间
                                    </td>
                                    <td>
                                        @Html.InputFor(m => m.ResolvedDate, new { disabled = true }, false)
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label">
                                        事件关闭人
                                    </td>
                                    <td>
                                        @Html.InputFor(m => m.CloseBy, new { disabled = true }, false)
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label">
                                        事件关闭时间
                                    </td>
                                    <td>
                                        @Html.InputFor(m => m.ClosedDateTime, new { disabled = true }, false)
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>  
    }
</div>
